@extends('admin.layout')
@section('content')

    
                    <div class="box">
                    <div class="row">
                    <form action="{{ url('/admin/type') }}" method="get">
                        <div class="col-md-6">
                         <label>
                           <select class="form-control input-sm" aria-controls="example1" name="pages">
                               <option 
                                @if(!empty($request['pages']) && $request['pages']==5)
                                selected='selected'
                                @endif
                               value="5">5</option>
                               <option 
                               @if(!empty($request['pages']) && $request['pages']==10)
                                selected='selected'
                                @endif
                               @if(empty($request['pages']))
                                selected='selected'
                                @endif 
                               value="10">10</option>
                               <option
                                @if(!empty($request['pages']) && $request['pages']==15)
                                selected='selected'
                                @endif
                               value="15">15</option>
                               <option 
                                @if(!empty($request['pages']) && $request['pages']==20)
                                selected='selected'
                                @endif
                               value="20">20</option>
                           </select>
                           </label>&nbsp条数据/页   
                        </div>
                        <div lass="col-md-6" align="right">
                         
                            <div class="box-tools" style="padding:10px">
                                <div class="input-group" style="width: 150px;">
                                    <input name="keyword" class="form-control input-sm pull-right" value="{{ $request['keyword'] or '' }}" placeholder="请输入要查询商品类型" type="text">
                                    <div class="input-group-btn">
                                        <button class="btn btn-sm btn-default"><i class="fa fa-search">搜索</i></button>
                                    </div>
                                </div>
                            </div>
                            
                        </div> 
                       </form>   
                    </div>

                        <div class="box-body table-responsive no-padding">
                            <table class="table table-hover">
                                
                                <tr>
                                    <th>ID</th>
                                    <th>商品类型</th>
                                    <th>父ID</th>                                    
                                    <th>路径</th> 
                                    <th>商品类型参数ID</th>                                   
                                    <th>操作</th>
                                </tr>
                                @foreach ($data as $type)
                                    <tr>
                                    <td class="ids">{{ $type -> id }} </td>
                                    <td class="cate_name">{{ $type -> cate_name }} </td>
                                    <td>{{ $type -> cate_pid }} </td>
                                    <td>{{ $type -> cate_path }} </td>
                                    <td>{{ $type -> goods_attrs_id }} </td>

                                    <td>
                                    <a href="{{ url('admin/type/add/') }}/{{ $type -> id }}"><span class="label label-info">添加子样式</span></a> ||
                                    <a href="{{ url('admin/type/edit/') }}/{{ $type -> id }}"><span class="label label-success">编辑</span></a> || 
                                    <a href="{{ url('admin/type/delete/') }}/{{ $type -> id }}"><span class="label label-danger">删除</span></a>
                                    </td>
                                </tr>
                                @endforeach
                                <tr align="right">
                                    <td colspan="6">{!! $data -> appends($request)->render() !!}</td>
                                </tr>
                            </table>
                            
                        </div><!-- /.box-body -->
                    </div><!-- /.box -->
                
@endsection